<template>
  <div class="outer1">
    <h1>我是Header组件</h1>
    <button @click="add(num)">累加</button>
    <p>{{ count }}</p>
  </div>
</template>

<script>
export default {
  name: "Hander",
  data() {
    return {
      count: 0,
    };
  },

  props:["num"],


  methods: {
    add(num) {
      this.count+=num
    },
  },
};
</script>

<style>
.outer1 {
  background-color: aqua;
  height: 150px;
}
</style>